package net.ch2.pc12.tech.ackborn.activity.thread;

import android.os.Handler;

public abstract class BaseThread extends Thread {

    protected Handler handler;

    protected Runnable listener;
    
    protected BaseThread(){
    	
    }
    
    public BaseThread(Handler handler,Runnable listener){
    	this.handler = handler;
    	this.listener = listener;
    }
    
    @Override
    public final void run(){
    	exec();
    	this.handler.post(this.listener);
    }
    
    public abstract void exec();
}
